import type { PatientItem, PatientParams } from "@/types/patient"
import { request } from "@/utils/http"

export const addPatientApi = (data: PatientParams) => {
  return request.post('/patient/add', data)
}

export const patientListApi = () => { 
  return request.get<null, PatientItem[]>('/patient/mylist')
}

export const removePatientApi = (id: string) => {
  return request.delete(`/patient/del/${id}`)
}

/**
 * 问诊-查询患者详情
 * @param id 患者id
 * @returns
 */
export const patientDetailApi = (id: string) => {
  return request.get<null, PatientItem>(`/patient/info/${id}`)
}

/**
 * 问诊-编辑患者信息
 * @param data
 * @returns
 */
export const updatePatientApi = (data: PatientParams) => {
  return request.put(`/patient/update`, data)
}